home *** CD-ROM | disk | FTP | other *** search
- set anExampleCam "{fieldOfView 40} \
- {projectionType perspective} \
- {backgroundColor {0 0 0}} \
- {doesDrawBackgroundColor 1} \
- {nearPlane -1} \
- {farPlane 100} \
- {eyePoint {1 1 -1}} \
- {viewPoint {0 0 0}} \
- {roll 0} \
- {pixelAspectRatio 1.0} \
- {fStop 2.8} \
- {focalLength 1.0} \
- {focalDistance 2.0} \
- {} \
- {}"
-
- lappend cam(templateList) anExampleCam
-
- # need to add the previous defined cameras into the current camera object
- # we do this by appending them to a variable list named cam(snapshotList)
- # this variable has traces set up on it so that when it is read or written
- # it accurately reflects the internal state of the camera
-
- # the following just does a simple linear interpolation from the start
- # camera's eye point to the end camera's eye point
- proc anExampleCameraInterpolationProc {u} {
-
- global sCam eCam cam
-
- set xDifference [expr {[lindex $eCam(eyePoint) 0] - [lindex $sCam(eyePoint) 0]};
- set yDifference [expr {[lindex $eCam(eyePoint) 1] - [lindex $sCam(eyePoint) 1]};
- set zDifference [expr {[lindex $eCam(eyePoint) 2] - [lindex $sCam(eyePoint) 2]};
-
- set newX [expr {$u * $xDifference}]
- set newY [expr {$u * $yDifference}]
- set newZ [expr {$u * $zDifference}]
-
- set newX [expr {$newX + [lindex $sCam(eyePoint) 0]}]
- set newY [expr {$newY + [lindex $sCam(eyePoint) 1]}]
- set newZ [expr {$newZ + [lindex $sCam(eyePoint) 2]}]
-
- set cam(eyePoint) "$newX $newY $newZ"
- }
-
- lappend cam(interpolationProcList) anExampleCameraInterpolationProc